﻿using Super.Hmi.Entities;

namespace Super.Hmi.IServices
{
    /// <summary>
    /// 用户管理服务接口类
    /// </summary>
    public interface IUserService : IBaseService
    {
        /// <summary>
        /// 获取所有用户列表
        /// </summary>
        /// <returns>用户实体集合</returns>
        IReadOnlyCollection<UserEntity> GetUsers();
        /// <summary>
        /// 查询用户列表
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="gender">性别</param>
        /// <param name="nickName">昵称</param>
        /// <param name="phone">手机号</param>
        /// <param name="email">邮箱</param>
        /// <param name="isActive">是否激活</param>
        /// <returns>用户实体集合</returns>
        IReadOnlyCollection<UserEntity> GetUsers(string userName, int gender, string nickName, string phone, string email, int isActive);
        /// <summary>
        /// 分页查询用户列表
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="gender">性别</param>
        /// <param name="nickName">昵称</param>
        /// <param name="phone">手机号</param>
        /// <param name="email">邮箱</param>
        /// <param name="isActive">是否激活</param>
        /// <param name="pageSize">一页数量</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="totalCount">总数</param>
        /// <returns>用户实体集合</returns>
        IReadOnlyCollection<UserEntity> GetUsers(string userName, int gender, string nickName, string phone, string email, int isActive, int pageSize, int pageIndex, out int totalCount);
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>用户实体</returns>
        UserEntity Login(string userName, string password);
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="userEntity">用户实体</param>
        /// <param name="roleIds">角色ids</param>
        void CreateUser(UserEntity userEntity, IEnumerable<int> roleIds);

        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="userEntity">用户实体</param>
        /// <param name="roleIds">角色ids</param>
        void UpdateUser(UserEntity userEntity, IEnumerable<int> roleIds);
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="userEntity">用户实体</param>
        /// <param name="newPassword">角色ids</param>
        void UpdateUserPassword(UserEntity userEntity, string newPassword);
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userId">用户id</param>
        void DeleteUser(int userId);
    }
}
